package com.heima.dfs;


import com.heima.model.common.dtos.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.Map;

@FeignClient(value = "leadnews-dfs" ,contextId = "dfs" , path = "/dfs")
public interface DfsFeign {

    /**
     * 基于文件字符串形式完成文件上传
     * @param content         文件字符串
     * @param fileExtension   文件后缀名
     * @return
     * @throws IOException
     */
    @PostMapping("/upload")
     ResponseResult<Map<String , Object>> uploadHtml(String content , String fileExtension) throws IOException;


    /**
     * 根据文件地址删除文件
     * @param param
     * @return
     */
    @DeleteMapping("/delete")
    ResponseResult deleteHtml(@RequestBody Map<String , String> param);


}
